package com.zbycorp.generatecode.service;

import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.zbycorp.generatecode.dto.SettingsStorageDTO;
import com.zbycorp.generatecode.service.impl.SettingsStorageServiceImpl;

/**
 * @author YCL
 * @date 2023/3/24
 */
public interface SettingsStorageService extends PersistentStateComponent<SettingsStorageDTO> {

    static SettingsStorageService getInstance(Project project) {
        return ServiceManager.getService(project, SettingsStorageServiceImpl.class);
    }

    static SettingsStorageDTO getSettingStorage(Project project) {
        return getInstance(project).getState();
    }

}
